package school.valon.persistence.pojo;

import java.io.Serializable;

import javax.persistence.*;

import java.util.List;


/**
 * The persistent class for the user_type database table.
 * 
 */
@Entity
@Table(name="staff_function")
@NamedQueries({
@NamedQuery(name="StaffFunction.findAll", query="SELECT sf FROM StaffFunction sf"),
@NamedQuery(name="StaffFunction.deleteById", query="DELETE FROM StaffFunction WHERE staffFunctionId = :P1")
})
public class StaffFunction implements Serializable {

	private static final long serialVersionUID = 5620287792514199929L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="staff_function_id")
	private Integer staffFunctionId;

	@Column(name="staff_function_name")
	private String staffFunctionName;

	@ManyToMany(fetch=FetchType.LAZY)
	@JoinTable(
			name="rel_staff_function"
			, joinColumns={
				@JoinColumn(name="staff_function_id", referencedColumnName="staff_function_id")
				}
			, inverseJoinColumns={
					@JoinColumn(name="staff_id", referencedColumnName="staff_id")				
				}
			)
	private List<Staff> staffs;

	public Integer getStaffFunctionId() {
		return this.staffFunctionId;
	}

	public void setStaffFunctionId(Integer staffFunctionId) {
		this.staffFunctionId = staffFunctionId;
	}

	public String getStaffFunctionName() {
		return this.staffFunctionName;
	}

	public void setStaffFunctionName(String staffFunctionName) {
		this.staffFunctionName = staffFunctionName;
	}

	public List<Staff> getStaffs() {
		return this.staffs;
	}

	public void setStaffs(List<Staff> staffs) {
		this.staffs = staffs;
	}

}